﻿<local:DocumentBase x:Class="WPFExcelReport.YGRABPRN"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"                    
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    FontSize="16"
                    Loaded="Window_Loaded"
>
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetDetail" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <CollectionViewSource   x:Key="vwABKOPF" Source="{Binding Path=ABKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwMaster" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWASTAMM" Source="{Binding Path=WASTAMM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwARANS" Source="{Binding Path=ARANS,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwLRPOS" Source="{Binding Path=LRPOS,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwABFOLGE" Source="{Binding Path=ABFOLGE,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwMU" Source="{Binding Path=ABAUFM,Source={StaticResource SetData}}" />

    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*" ></RowDefinition>
            <RowDefinition Height="1*" ></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
            Name="expLog" ExpandDirection="Down" IsExpanded="True">
            <StackPanel>
                <WrapPanel Name="zoneCommand" Margin="4,0,51,6" Grid.ColumnSpan="3">
                    <Label Content="系统" Width="Auto" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0" Text="00" HorizontalAlignment="Left" Background="Pink"  TabIndex="1" />
                    <Label Content="语言" Width="Auto" Margin="0,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                    <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                    <Label Content="用户名" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                    <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                    <Label Content="密码" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                    <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow"  KeyboardNavigation.TabIndex="1" TabIndex="4" />
                    <Button Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">
                        登录
                    </Button>
                    <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="14" KeyboardNavigation.TabIndex="1" />
                </WrapPanel>
            </StackPanel>
        </Expander>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*" ></RowDefinition> 
                </Grid.RowDefinitions> 
                <WrapPanel Grid.Row="0" Name="ZoneOrder">
                <TextBlock Width="Auto">生产单:</TextBlock>
                <TextBox   Name="txtAUFKRS" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                <TextBox   Name="txtAUFLFD" MaxLength="6" Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" KeyUp="txtAUFLFD_KeyUp" />
                <TextBox   Name="txtAUFPOS" MaxLength="6" Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBlock FontSize="18"    Width="59" Name="txt1" Margin="0,0,0,0" Text="生产单" />
                <Button FontSize="18" Content="查询"  BorderBrush="Yellow" Margin="20,0,0,0"   Click="btnQuery_Click" ></Button>
                <Button Content="打印"  FontSize="18"   BorderBrush="Yellow" Margin="20,0,0,0"   Width="Auto" Click="btnPrintABDOC_Click"/>
            </WrapPanel> 
                <DataGrid Grid.Row="1" Grid.Column="0" Margin="0,1,0,0" 
                          FontSize="12"
                          CanUserReorderColumns="True"  
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"   
                  >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="" Binding="{Binding ABPAUFKRS}" Width="40"/>
                        <DataGridTextColumn Header="生产单" Binding="{Binding ABPAUFLFD}" Width="80"/>
                        <DataGridTextColumn Header="" Binding="{Binding ABPAUFPOS}" Width="40"/>
                        <DataGridTextColumn Header="品种" Binding="{Binding ABPART}" Width="160"/>
                        <DataGridTextColumn Header="版本" Binding="{Binding ABPVAR}" Width="40"/>
                        <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}" Width="80"/>
                        <DataGridTextColumn Header="KG" Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}" Width="60"/>
                        <DataGridTextColumn Header="开始" Binding="{Binding ABPSTARTDAT}" Width="80"/>
                        <DataGridTextColumn Header="交期" Binding="{Binding ABPENDDAT}" Width="80"/>
                        <DataGridTextColumn Header="行备注" Binding="{Binding REMARK, Converter={StaticResource ResourceKey=gb2312}}" Width="200"/>
                    </DataGrid.Columns>
                </DataGrid  > 
            </Grid>
        </StackPanel>
        <TabControl Grid.Row="2" Grid.Column="0"  Grid.ColumnSpan="2">
          
            <TabItem Header="生产单" >
                <Grid   >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" /> 
                        <RowDefinition Height="1*" />
                    </Grid.RowDefinitions> 
                    <StackPanel Grid.Row="0"  >
                        <WrapPanel Visibility="Collapsed">
                            <TextBlock FontSize="18"  Height="40"   Width="Auto"  Margin="0,0,0,0" Text="生产单" />
                            <Button    FontSize="18" Height="40"  Width="40" Margin="20,0,0,0"  Click="btnPrintABDOC_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="Images/Print.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel>
                    </StackPanel>
                 
           <DataGrid Margin="0,1,0,0" Grid.Row="1"
                                  CanUserReorderColumns="True"  
                                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                                  AutoGenerateColumns="False"   
                                  EnableRowVirtualization="True"  
                                  FontSize="12"
                                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                  IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwABFOLGE}}"   
                  >
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="步骤" Binding="{Binding ABFAFOLGE}" Width="40"/>
                                <DataGridTextColumn Header="操作" Binding="{Binding ABFAGANG, Converter={StaticResource ResourceKey=gb2312}}" Width="80"/>
                                <DataGridTextColumn Header="操作" Binding="{Binding ABFBEAGANG, Converter={StaticResource ResourceKey=gb2312}}" Width="80"/>
                                <DataGridTextColumn Header="" Binding="{Binding ABFKSTKRS}" Width="160"/>
                                <DataGridTextColumn Header="工作中心" Binding="{Binding ABFKST}" Width="60"/>
                                <DataGridTextColumn Header="设备类型" Binding="{Binding ABFMTYP}" Width="160"/>
                                <DataGridTextColumn Header="开始日期" Binding="{Binding ABFSOLLSTART}" Width="60"/>
                            </DataGrid.Columns>
                        </DataGrid  > 
                </Grid>
            </TabItem>
            <TabItem Header="配方单" Visibility="Collapsed">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0">
                        <WrapPanel>
                            <TextBlock     Width="59"  Margin="0,0,0,0" Text="生产单" />
                            <TextBox Background="White"      Width="40" CharacterCasing="Upper" Margin="0,0,0,0" Text="{Binding ARAAUFKRS, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBox Background="White"     Width="80"   Margin="0,0,0,0" Text="{Binding ARAAUFLFD, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBox Background="White"     Width="40"  Margin="0,0,0,0" Text="{Binding ARAAUFPOS, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBox Background="White"       Width="40"  Margin="0,0,0,0" Text="{Binding ARAANSNR, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBox Background="White"      Width="40" Margin="0,0,0,0" Text="{Binding ARAAFOLGE, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBlock     Width="59"  Margin="0,0,0,0" Text="纱线" />
                            <TextBlock Background="White"     Width="200"   Margin="0,0,0,0" Text="{Binding ABPART, Source={StaticResource ResourceKey=vwMaster}}" />
                            <TextBlock Background="White"     Width="100"  Margin="0,0,0,0" Text="{Binding ABPFARBE, Source={StaticResource ResourceKey=vwMaster}}" />
                        </WrapPanel>
                        <WrapPanel>
                            <TextBlock     Width="Auto"  Margin="0,0,0,0" Text="染缸" />
                            <TextBlock Background="White"    Width="40"  Margin="10,0,0,0" Text="{Binding ARAMNRKRS, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBlock Background="White"   Width="80"  Margin="10,0,0,0" Text="{Binding ARAMLFDNR, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBlock Background="White"     Width="40"   Margin="10,0,0,0" Text="{Binding ARAMPOS, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBlock     Width="Auto"  Margin="0,0,0,0" Text="配方" />
                            <TextBlock Background="White"     Width="40"  Margin="0,0,0,0" Text="{Binding ARAREZART, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBlock Background="White" Width="200"  Margin="0,0,0,0" Text="{Binding ARAREZNR, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBlock    Width="Auto"  Margin="0,0,0,0" Text="数量" />
                            <TextBlock Background="White"     Width="100"  Margin="0,0,0,0" Text="{Binding  ARAMGKG,Converter={StaticResource ResourceKey=d1000}, Source={StaticResource ResourceKey=vwARANS}}" />
                            <TextBox     Width="Auto"  Margin="0,0,0,0" Text="水量" />
                            <TextBlock Background="White"    Width="100"  Margin="0,0,0,0" Text="{Binding ARAFLOTTE, Converter={StaticResource ResourceKey=d1000}, Source={StaticResource ResourceKey=vwARANS}}" />
                        </WrapPanel>
                        <WrapPanel>
                            <Button Content="打印" Height="40" Margin="20,0,0,0" Width="Auto" Click="btnPrintAR_Click"/>
                        </WrapPanel>
                    </StackPanel>
                    <DataGrid Grid.Row="1" Grid.Column="0" Margin="0,1,0,0" 
            CanUserReorderColumns="True"  
                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                  AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwLRPOS}}"   
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="染化料" Binding="{Binding MSBEZ, Converter={StaticResource ResourceKey=gb2312}}" Width="80"/>
                            <DataGridTextColumn Header="编号" Binding="{Binding LRPKOMP}" Width="160"/>
                            <DataGridTextColumn Header="用量g" Binding="{Binding LRPDRUCK}" Width="60"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>
            </TabItem>
            <TabItem Header="染批标签" Visibility="Collapsed">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0">
                        <WrapPanel>
                            <TextBlock     Width="59"  Margin="0,0,0,0" Text="染批行" />
                            <TextBox Background="White"     Width="200"   Margin="0,0,0,0" Text="{Binding ABAKDPARTIE, Source={StaticResource ResourceKey=vwMU}}" />
                            <TextBlock     Width="59"  Margin="0,0,0,0" Text="经纬纱" />
                            <ComboBox  Text="{Binding Path=ABABEM2,Converter={ StaticResource ResourceKey=gb2312}, Source={StaticResource ResourceKey=vwMU}}"
                                       Width="100">
                                <ComboBoxItem Content="经纱"></ComboBoxItem>
                                <ComboBoxItem Content="纬纱"></ComboBoxItem>
                                <ComboBoxItem Content="经纬"></ComboBoxItem>
                            </ComboBox> 
                           <Button Content="打印" Height="40" Margin="20,0,0,0" Width="Auto" Click="btnPrintMU_Click"/>
                        </WrapPanel>
                    </StackPanel>
                    <DataGrid Grid.Row="1" Grid.Column="0" Margin="0,1,0,0" 
            CanUserReorderColumns="True"  
                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                  AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                              Name="dlgMU"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwMU}}"   
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="" Binding="{Binding ABAAUFKRS}" Width="Auto"/>
                            <DataGridTextColumn Header="生产单" Binding="{Binding ABAAUFLFD}" Width="Auto"/>
                            <DataGridTextColumn Header="" Binding="{Binding ABAAUFPOS}" Width="Auto"/>
                            <DataGridTextColumn Header="行号" Binding="{Binding ABAAPOS}" Width="Auto"/>
                            <DataGridTextColumn Header="染批" Binding="{Binding ABAKDPARTIE}" Width="Auto"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</local:DocumentBase>
